﻿using Microsoft.AspNetCore.Mvc;

namespace In66.Web.Controllers
{

    /// <summary>
    /// AliController
    /// </summary>
    [Route("[controller]/[action]")]
    [ApiController]
    public class HomeController : Controller
    {
        private ILogger<HomeController> _logger;

        public HomeController(ILogger<HomeController> logger)
        {
            _logger= logger;
        }

        public IActionResult Index()
        {
            //_logger.LogError($"日志来自控制台发生了错误:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");

            _logger.LogWarning($"日志来自文件发生了告警:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");

            _logger.LogError($"日志来自文件发生了错误:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");

            return Ok("Index");
        }
    }
}
